import React, {FC} from "react";
import {Outlet} from "react-router-dom";
import useLoadingUserData from "../hooks/useLoadingUserData";
import {Spin} from "antd";
import useNavPage from "../hooks/useNavPage";
//这个组件的存在是为了页面而存在的，因为每个页面存在相同的东西，所以使用layout进行复用
const QuestionLayout :FC=()=>{
    //加载用户数据
    const {waiting } =useLoadingUserData();
    useNavPage(waiting);
    return(
        <>
            <div> QuestionLayout</div>
            <div>
                {waiting ?<div style={{textAlign:"center",marginTop:"100px"}}>
                    <Spin/>
                </div>:<Outlet/>}
            </div>
            <div>footer</div>
        </>

    )
}

export  default QuestionLayout;